home *** CD-ROM | disk | FTP | other *** search
/ Future Workshop / Future Workshop.iso / multimed / qtw111 / pviewer / qtole.h < prev    next >
Text File  |  1993-09-20  |  9KB  |  251 lines

  1.  
  2. // ---------------------------------------------------------------------
  3. //
  4. // QTOle.h - OLE Server - QuickTime for Windows
  5. //
  6. //           Version 1.0
  7. //
  8. //           (c) 1988-1992 Apple Computer, Inc. All Rights Reserved.
  9. //
  10. // ---------------------------------------------------------------------
  11.  
  12.  
  13. // Prevent multiple inclusion
  14. // --------------------------
  15.    #ifndef QTOLE_H
  16.       #define QTOLE_H
  17.  
  18.    #include <qtw.h>
  19.  
  20. // defines
  21. // -------
  22.    #ifndef MAX_PATH_LEN
  23.    #define MAX_PATH_LEN      256
  24.    #endif
  25.  
  26.    #ifndef MAX_TEXT_LEN
  27.    #define MAX_TEXT_LEN       64
  28.    #endif
  29.  
  30.      // Object type ids. Application can support one or the other
  31.    #define MOVIE_OBJECT     0x0001
  32.    #define PICTURE_OBJECT   0x0002
  33.  
  34.    #define VERSION_1             1
  35.    #define DEFAULT_RATE       MAKELFIXED( 1, 0 )
  36.  
  37.    #define QTOLE_API     CALLBACK __loadds
  38.  
  39.  
  40. // typedefs
  41. // ----------   
  42.    typedef LONG    QTOLE_ERR;
  43.    typedef struct  _tagQTOLE_OPTIONS    FAR *LPQTOLE_OPTIONS;
  44.  
  45.    typedef QTOLE_ERR (CALLBACK *QTOLEPROC) (UINT, WPARAM, LPARAM, LPQTOLE_OPTIONS);
  46.  
  47.    typedef struct _tagQTOLE_INIT
  48.       {DWORD              lStructSize;
  49.        LONG               lVersion;
  50.        HINSTANCE          hInstance;
  51.        HINSTANCE          hResources;
  52.        LPSTR              lpCmdLine;
  53.        LPCSTR             lpClassName;
  54.        LPCSTR             lpServerCaption;
  55.        LPINT              lpnCmdShow;
  56.        WORD               wIDFirstString;
  57.        WORD               wIDFirstDlg;
  58.        BOOL               bMultipleObjectServer;               
  59.        QTOLEPROC          fpServerCallBack; 
  60.  
  61.       } QTOLE_INIT;
  62.    typedef QTOLE_INIT FAR *LPQTOLE_INIT;
  63.  
  64.  
  65.    typedef struct _tagQTOLE_OLEDATA
  66.       {DWORD              lStructSize;
  67.        LONG               lVersion;
  68.        WORD               wObjectType;
  69.        LPVOID             lpqtoleServer;
  70.  
  71.       } QTOLE_OLEDATA;
  72.    typedef QTOLE_OLEDATA FAR *LPQTOLE_OLEDATA;
  73.  
  74.  
  75.    typedef struct _tagQTOLE_OPENWND
  76.       {DWORD              lStructSize;
  77.        LONG               lVersion;
  78.        WORD               wObjectType;
  79.        HWND               hwndObject;
  80.        LPCSTR             lpObjectPath;
  81.        LPCSTR             lpObjectName;
  82.       } QTOLE_OPENWND;
  83.    typedef QTOLE_OPENWND FAR *LPQTOLE_OPENWND;
  84.  
  85.  
  86.    typedef struct _tagQTOLE_OPTIONS
  87.       {DWORD              lStructSize;
  88.        LONG               lVersion;
  89.        WORD               wObjectType;
  90.        HWND               hwndObject;
  91.       } QTOLE_OPTIONS;
  92.  
  93.    typedef struct _tagQTOLE_OPTIONSMOVIE
  94.       {DWORD              lStructSize;
  95.        LONG               lVersion;
  96.        WORD               wObjectType;
  97.        HWND               hwndObject;
  98.             // movie handle
  99.        Movie              mMovie;
  100.        LFIXED             lfxRate;
  101.        BOOL               bSoundOnlyMovie;
  102.             // movie copy options
  103.        BOOL               bCopyCurrentFrame;
  104.        BOOL               bCopyIcon;
  105.        BOOL               bShowTitleBar;
  106.        TimeValue          tvDisplayFrame;
  107.             // looping options
  108.        BOOL               bLoop;
  109.        BOOL               bLoopPalindrome;
  110.             // play selection option
  111.        BOOL               bPlaySelectionOnly;
  112.             // size data
  113.        SIZE               sizeNormal;
  114.        SIZE               sizeCurrent;
  115.             // size options
  116.        BOOL               bSizeHalf;
  117.        BOOL               bSizeNormal;
  118.        BOOL               bSizeDouble;
  119.             // miscellaneous options
  120.        BOOL               bShowMovieController;
  121.        BOOL               bUseMoviePalette;
  122.        BOOL               bDrawWindowFrame;
  123.             // caption data
  124.        char               szCaption[MAX_TEXT_LEN];
  125.             // selection and duration data
  126.        TimeRecord         trSelStart;
  127.        TimeRecord         trSelDuration;
  128.        TimeValue          tvMovieDuration;
  129.  
  130.       } QTOLE_OPTIONSMOVIE;
  131.    typedef QTOLE_OPTIONSMOVIE FAR *LPQTOLE_OPTIONSMOVIE;
  132.  
  133.  
  134.    typedef struct _tagQTOLE_OPTIONSPICTURE
  135.       {DWORD              lStructSize;
  136.        LONG               lVersion;
  137.        WORD               wObjectType;
  138.        HWND               hwndObject;
  139.             // Picture handle
  140.        PicHandle          phPicture;
  141.             // Picture copy options
  142.        BOOL               bCopyIcon;
  143.        BOOL               bShowTitleBar;
  144.        RECT               rcSelection;
  145.             // size data
  146.        WORD               wZoomCurrent;    // 100 is 1 x 1, 200 is 2 x expansion, etc
  147.             // size options
  148.        BOOL               bZoomHalf;
  149.        BOOL               bZoomNormal;
  150.        BOOL               bZoomDouble;
  151.             // miscellaneous options
  152.        BOOL               bShowPictureControls;
  153.        BOOL               bUsePicturePalette;
  154.        BOOL               bDrawWindowFrame;
  155.             // caption data
  156.        char               szCaption[MAX_TEXT_LEN];
  157.  
  158.       } QTOLE_OPTIONSPICTURE;
  159.    typedef QTOLE_OPTIONSPICTURE FAR *LPQTOLE_OPTIONSPICTURE;
  160.  
  161.  
  162. // Callback function message IDS
  163. // -----------------------------
  164.    #define QTOLE_MSG_OPENOBJECT        0x0100   
  165.    #define QTOLE_MSG_SHOWOBJECT        0x0101   
  166.    #define QTOLE_MSG_OPENOPTIONSDLG    0x0102
  167.    #define QTOLE_MSG_PLAYOBJECT        0x0103
  168.    #define QTOLE_MSG_FILEOPEN          0x0104   
  169.  
  170. // Localized string id offsets
  171. // ---------------------------
  172.    #define QTOLE_STR_OFFSET_READABLENAME       0
  173.    #define QTOLE_STR_OFFSET_PLAY               1
  174.    #define QTOLE_STR_OFFSET_EDIT               2
  175.    #define QTOLE_STR_OFFSET_OPTIONS            3
  176.    #define QTOLE_STR_OFFSET_UPDATA             4
  177.    #define QTOLE_STR_OFFSET_ALREADYINSERTING   5
  178.    #define QTOLE_STR_OFFSET_WHEREFILE          6
  179.    #define QTOLE_STR_OFFSET_UPDATEPATH         7
  180.    #define QTOLE_STR_OFFSET_NOTFILESIZE        8
  181.    #define QTOLE_STR_OFFSET_NOTFILENAME        9
  182.    #define QTOLE_STR_OFFSET_SEARCHDIRS        10
  183.    #define QTOLE_STR_OFFSET_FILENOTFOUND      11
  184.  
  185. // Localized dialog template id offsets
  186. // ---------------------------
  187.    #define QTOLE_DLG_OFFSET_SEARCHDLG       0
  188.  
  189.  
  190. // Error Codes
  191. // -----------
  192.    enum
  193.       {QTOLE_OK                  =   0L,
  194.        QTOLE_GEN_ERROR           =   1L,
  195.        QTOLE_INSTALL_ONLY        =   2L,
  196.        QTOLE_CMDLINE_SYNTAX      =   3L,
  197.        QTOLE_SERVERWRONGVERSION  =   4L,
  198.        QTOLE_NATIVEWRONGVERSION  =   5L,
  199.        QTOLE_NOMEMORY            =   6L,
  200.        QTOLE_OLEINITFAILURE      =   7L,
  201.        QTOLE_BAD_INPUT_FOR_REG   =   8L,
  202.        QTOLE_REGFAILED           =   9L,
  203.        QTOLE_NOSERVERDATA        =  10L,
  204.        QTOLE_COPYFAILED          =  11L, 
  205.        QTOLE_INVALIDDATAREF      =  12L,
  206.        QTOLE_NEWMOVIEERR         =  13L,
  207.        QTOLE_NOVIDEOINFO         =  14L,
  208.        QTOLE_NOCONTROLLER        =  15L
  209.  
  210.       };
  211.  
  212. // Interface Prototypes
  213. // --------------------
  214.        // Call before application CreateWindow in startup code
  215.    QTOLE_ERR  QTOLE_API QTOLE_Initialize          (LPQTOLE_OLEDATA, LPQTOLE_INIT);  
  216.  
  217.        // Call after application CreateWindow returns an hwnd
  218.    VOID       QTOLE_API QTOLE_SetApplicationHwnd  (LPQTOLE_OLEDATA, HWND);
  219.    
  220.        // Call during creation of object window. This may or may not be the main app
  221.        // window
  222.    QTOLE_ERR  QTOLE_API QTOLE_OpeningNewObjectWnd (LPQTOLE_OLEDATA, LPQTOLE_OPENWND);
  223.  
  224.        // Call during Edit-Copy processing
  225.    QTOLE_ERR  QTOLE_API QTOLE_Copy                (LPQTOLE_OLEDATA, LPQTOLE_OPTIONS);
  226.  
  227.        // Used to open an object wnd in response to the QTOLE_MSG_PLAYOBJECT 
  228.        // call in the server callback function.  The server must post a message
  229.        // to itself to call this function.  
  230.    QTOLE_ERR  QTOLE_API QTOLE_PlayObject          ( LPQTOLE_OLEDATA, LPARAM );
  231.  
  232.        // Called after closing Options dlg when it is opened as a result of
  233.        // QTOle.dll sending message 
  234.    VOID       QTOLE_API QTOLE_ClosedOptionsDlg    (LPQTOLE_OLEDATA, 
  235.                                                               LPQTOLE_OPTIONS, BOOL);
  236.  
  237.        // Call during document WM_CLOSE or WM_DESTROY processing
  238.    BOOL       QTOLE_API QTOLE_ClosingDocWnd       (LPQTOLE_OLEDATA, LPQTOLE_OPTIONS);
  239.  
  240.        // Called during File menu popup initialization
  241.    BOOL       QTOLE_API QTOLE_IsActiveObjectWnd   (LPQTOLE_OLEDATA, HWND, LPSTR);
  242.  
  243.  
  244.        // Call during server WM_CLOSE or WM_DESTROY processing
  245.    BOOL       QTOLE_API QTOLE_ClosingServerWnd    (LPQTOLE_OLEDATA, UINT); 
  246.  
  247.        // Call after exiting message loop
  248.    QTOLE_ERR  QTOLE_API QTOLE_OLECleanUp          (LPQTOLE_OLEDATA);  
  249.  
  250.    #endif
  251.